﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="CotaRegra.aspx.cs" Inherits="Financeiro.CotaRegra" %>
<asp:Content ID="HeaderContent" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="setor" DataSourceID="Labsoft">
        <Columns>
            <asp:BoundField DataField="setor" HeaderText="setor" ReadOnly="True" 
                SortExpression="setor" />
            <asp:BoundField DataField="limite" HeaderText="limite" 
                SortExpression="limite" />
            <asp:BoundField DataField="minimo" HeaderText="minimo" 
                SortExpression="minimo" />
            <asp:CommandField ShowEditButton="True" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="Labsoft" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ERP_FinanceiroConnectionString %>" 
        DeleteCommand="DELETE FROM [RegraCota] WHERE [setor] = @setor" 
        InsertCommand="INSERT INTO [RegraCota] ([setor], [limite], [minimo]) VALUES (@setor, @limite, @minimo)" 
        SelectCommand="SELECT * FROM [RegraCota]" 
        UpdateCommand="UPDATE [RegraCota] SET [limite] = @limite, [minimo] = @minimo WHERE [setor] = @setor">
        <DeleteParameters>
            <asp:Parameter Name="setor" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="setor" Type="String" />
            <asp:Parameter Name="limite" Type="Double" />
            <asp:Parameter Name="minimo" Type="Double" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="limite" Type="Double" />
            <asp:Parameter Name="minimo" Type="Double" />
            <asp:Parameter Name="setor" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>

</asp:Content>
